/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ScannerParser;

import java.util.*;

/**
 *
 * @author jefoutta
 */
public class Error {
    public static boolean error;
    public static boolean syntaxError;
    public static LinkedList<String> message;
    private static String middleCode = "";

    public static void addMiddleCode(ThreeDirectionInstruction tdi){
        for(int i = 0; i < tdi.getSize(); i++){
            middleCode = middleCode + tdi.getInstruction(i) +"\n";
        }
    }

    public static void addMiddleCode(LinkedList<String> datacode){
        for(int i = 0; i < datacode.size(); i++){
            middleCode = middleCode + datacode.get(i) + "\n";
        }
    }

    public static void setMiddleCode(String code){
        middleCode = code;
    }

    public static String getMiddleCode(){
        return middleCode;
    }

    public static String toPrint(){
        String s = "";
        for(int i = 0; i < message.size(); i++){
            s = s+"--------------------\n"+message.get(i)+"\n";
        }
        return s;
    }
}
